﻿namespace BJYJ_Admin.Core.Utils.DtoUtils
{
    /// <summary>
    /// 分页响应泛型类（所有分页接口返回此格式）
    /// </summary>
    /// <typeparam name="T">数据类型</typeparam>
    public class PageResult<T>
    {
        /// <summary>
        /// 当前页码
        /// </summary>
        public int page { get; set; }

        /// <summary>
        /// 每页数量
        /// </summary>
        public int limit { get; set; }

        /// <summary>
        /// 总记录数
        /// </summary>
        public int totalcount { get; set; }

        /// <summary>
        /// 分页数据列表
        /// </summary>
        public List<T> data { get; set; }

        /// <summary>
        /// 总页数
        /// </summary>
        public int totalpages => (int)Math.Ceiling(totalcount / (double)limit);

    }
}
